Skip to content

feat(contributions): first-1k founding contributor award#3972

Merged
idoshamun merged 1 commit into
mainfrom
feat/contribution-founding-award
Jul 2, 2026
Merged

feat(contributions): first-1k founding contributor award#3972
idoshamun merged 1 commit into
mainfrom
feat/contribution-founding-award

Conversation

@idoshamun

Copy link
Copy Markdown
Member

Grants a founding-contributor award to the first 1000 contributors, live as they earn their first approved submission.

What's included

  • ContributionFoundingContributor entity (userId PK) + migration — doubles as the idempotency marker and the cap counter.
  • grantFoundingContributorAward — reserves a founding slot under the cap, then issues the award as a system-paid Product award: a UserTransaction with senderId = systemUser.id + transferCores, so the receiver gets the award's Cores value (mirrors fulfillContributionCoresReward). The whole grant is transactional, so a failed Cores transfer rolls back the reservation and retries cleanly.
  • Idempotent per user via the founding PK (ON CONFLICT DO NOTHING, checked through RETURNINGidentifiers is unreliable for a provided PK). Cap is best-effort under concurrency, matching the existing referral-award approach.
  • Worker fires on api.v1.contribution-action-completed (same low-frequency approved-submission event as milestones).
  • Award product id comes from the CONTRIBUTION_FOUNDING_AWARD_PRODUCT_ID env var; the grant is a no-op until it's set, so this can ship before the dedicated product exists.

Notes

  • Uses referenceType = user (like a normal user award) so the standard "you received an award" notification fires for the receiver.
  • Migration cleaned to just the table + FK (generator drift stripped).

PR 2 of 3 for the giveback launch (next: leaderboard + causes breakdown). Depends on the merged milestones PR only for the shared worker topic.

Grant a founding-contributor award to the first 1000 contributors.

- ContributionFoundingContributor entity + migration (idempotency marker + cap counter)
- grantFoundingContributorAward: system-sender Product award via transferCores,
  Cores value paid to the receiver; transactional, idempotent per user, best-effort cap
- Award product id comes from the CONTRIBUTION_FOUNDING_AWARD_PRODUCT_ID env var
  (no-op until set)
- Worker fires on the approved-submission event
@pulumi

pulumi Bot commented Jul 2, 2026

Copy link
Copy Markdown

🍹 The Update (preview) for dailydotdev/api/prod (at cae4fb0) was successful.

Resource Changes

    Name                                                    Type                                  Operation
~   vpc-native-rotate-weekly-quests-cron                    kubernetes:batch/v1:CronJob           update
~   vpc-native-clean-zombie-users-cron                      kubernetes:batch/v1:CronJob           update
~   vpc-native-temporal-deployment                          kubernetes:apps/v1:Deployment         update
~   vpc-native-ws-deployment                                kubernetes:apps/v1:Deployment         update
~   vpc-native-validate-active-users-cron                   kubernetes:batch/v1:CronJob           update
~   vpc-native-materialize-monthly-best-post-archives-cron  kubernetes:batch/v1:CronJob           update
~   vpc-native-update-tag-materialized-views-cron           kubernetes:batch/v1:CronJob           update
~   vpc-native-deployment                                   kubernetes:apps/v1:Deployment         update
~   vpc-native-clean-old-notifications-cron                 kubernetes:batch/v1:CronJob           update
~   vpc-native-generic-referral-reminder-cron               kubernetes:batch/v1:CronJob           update
~   vpc-native-post-lifecycle-state-clickhouse-cron         kubernetes:batch/v1:CronJob           update
~   vpc-native-update-trending-cron                         kubernetes:batch/v1:CronJob           update
~   vpc-native-clean-stale-user-transactions-cron           kubernetes:batch/v1:CronJob           update
~   vpc-native-channel-highlights-cron                      kubernetes:batch/v1:CronJob           update
~   vpc-native-daily-digest-cron                            kubernetes:batch/v1:CronJob           update
-   vpc-native-api-db-migration-456bb00c                    kubernetes:batch/v1:Job               delete
~   vpc-native-clean-gifted-plus-cron                       kubernetes:batch/v1:CronJob           update
+   api-sub-api.contribution-action-completed-founding      gcp:pubsub/subscription:Subscription  create
~   vpc-native-post-analytics-clickhouse-cron               kubernetes:batch/v1:CronJob           update
~   vpc-native-clean-channel-highlights-cron                kubernetes:batch/v1:CronJob           update
~   vpc-native-update-highlighted-views-cron                kubernetes:batch/v1:CronJob           update
~   vpc-native-update-source-public-threshold-cron          kubernetes:batch/v1:CronJob           update
~   vpc-native-rotate-daily-quests-cron                     kubernetes:batch/v1:CronJob           update
~   vpc-native-check-analytics-report-cron                  kubernetes:batch/v1:CronJob           update
~   vpc-native-user-profile-updated-sync-cron               kubernetes:batch/v1:CronJob           update
~   vpc-native-calculate-top-readers-cron                   kubernetes:batch/v1:CronJob           update
~   vpc-native-update-current-streak-cron                   kubernetes:batch/v1:CronJob           update
~   vpc-native-materialize-yearly-best-post-archives-cron   kubernetes:batch/v1:CronJob           update
~   vpc-native-update-achievement-rarity-cron               kubernetes:batch/v1:CronJob           update
~   vpc-native-personalized-digest-deployment               kubernetes:apps/v1:Deployment         update
~   vpc-native-expire-super-agent-trial-cron                kubernetes:batch/v1:CronJob           update
~   vpc-native-private-deployment                           kubernetes:apps/v1:Deployment         update
~   vpc-native-bg-deployment                                kubernetes:apps/v1:Deployment         update
~   vpc-native-post-analytics-achievements-cron             kubernetes:batch/v1:CronJob           update
+   vpc-native-api-clickhouse-migration-d178395e            kubernetes:batch/v1:Job               create
~   vpc-native-update-views-cron                            kubernetes:batch/v1:CronJob           update
~   vpc-native-clean-zombie-opportunities-cron              kubernetes:batch/v1:CronJob           update
-   vpc-native-api-clickhouse-migration-456bb00c            kubernetes:batch/v1:Job               delete
~   vpc-native-sync-subscription-with-cio-cron              kubernetes:batch/v1:CronJob           update
~   vpc-native-hourly-notification-cron                     kubernetes:batch/v1:CronJob           update
~   vpc-native-clean-zombie-images-cron                     kubernetes:batch/v1:CronJob           update
... and 16 other changes

@idoshamun idoshamun merged commit 435583e into main Jul 2, 2026
9 checks passed
@idoshamun idoshamun deleted the feat/contribution-founding-award branch July 2, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant